﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Xfs
{
    /// 消息分发类型的Mailbox,对mailbox中的消息进行分发处理
    [XfsMailboxHandler(XfsSenceType.XfsClient, XfsMailboxType.MessageDispatcher)]
    public class C4S_XfsMailboxMessageDispatcherHandler : IXfsMailboxHandler
    {
        public async XfsTask Handle(XfsSession session, XfsEntity entity, object actorMessage)
        {
            try
            {
                await XfsGame.XfsSence.GetComponent<XfsActorMessageDispatcherComponent>().Handle(entity, new XfsActorMessageInfo() { Session = session, Message = actorMessage });
            }
            catch (Exception e)
            {
                //Log.Error(e);
            }
        }
    }
}
